<template>
  <div class="home">
    <input type="text" name="textinput" id="textinput" placeholder="输入你要做的事情" v-model="pathname">
      
      <button type="submit" @click="submit">立即保存</button>
      <button type="submit" @click="latesubmit">延时保存</button>
  </div>
</template>

<script>


export default {
  name: 'HomeView',
  data(){
    return{
      pathname:"",
    }
  },
  methods:{
      submit(){
          
          this.$store.commit('savepath',this.pathname)
          console.log(this.pathname)
          this.$router.push('/About/')
      },
      latesubmit(){
        this.$store.dispatch('delaystore',this.pathname)
        this.$router.push('/About/')
      }
  }
}
</script>
